package com.lesama.test;

import com.lesama.domain.Student;

import java.util.ArrayList;

public class ArrayListTest2 {
    public static void main(String[] args) {
        Student stu1 = new Student("ts", 24);
        Student stu2 = new Student("rk", 25);
        Student stu3 = new Student("jiejie", 23);
        ArrayList<Student> list = new ArrayList<>();
        list.add(stu1);
        list.add(stu2);
        list.add(stu3);
        for (int i = 0; i < list.size(); i++) {
            if(list.get(i).getAge() > 24) {
                System.out.println(list.get(i).toString());
            }
        }
    }

}
